Skip to content

fix: tag rename capitalization#555

Merged
bradenmacdonald merged 6 commits intoopenedx:mainfrom
jesperhodge:fix--tag-rename-capitalization
Apr 23, 2026
Merged

fix: tag rename capitalization#555
bradenmacdonald merged 6 commits intoopenedx:mainfrom
jesperhodge:fix--tag-rename-capitalization

Conversation

@jesperhodge
Copy link
Copy Markdown
Contributor

@jesperhodge jesperhodge commented Apr 20, 2026

Fixes openedx/modular-learning#274

Testing Instructions

  • In Course Authoring, go to taxonomies - open a taxonomy detail view
  • Go to a tag row, click three dot menu in the row
  • Rename tag to the same name, only change capitalization (e.g. "Science" becomes "science"), nothing else
  • It should successfully rename the tag to the new capitalization and should not show any error

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 20, 2026
@openedx-webhooks
Copy link
Copy Markdown

Thanks for the pull request, @jesperhodge!

This repository is currently maintained by @axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes tag rename behavior so that updating a tag’s value with only capitalization changes (e.g., Sciencescience) is treated as a valid update rather than a duplicate-value error. This aligns the tagging API behavior with the Course Authoring taxonomy UI rename flow.

Changes:

  • Add a regression test covering capitalization-only tag rename via the taxonomy tags update endpoint.
  • Update tag value uniqueness validation to exclude the tag being updated from the “already exists” check.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/openedx_tagging/test_views.py Adds a test ensuring capitalization-only renames succeed (HTTP 200) and return the updated value.
src/openedx_tagging/rest_api/v1/serializers.py Adjusts uniqueness validation to avoid flagging the tag itself as a duplicate during updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/openedx_tagging/rest_api/v1/serializers.py
@ormsbee
Copy link
Copy Markdown
Contributor

ormsbee commented Apr 20, 2026

Just so I'm clear: Is the idea that we don't allow tags that differ just by case, i.e. I couldn't have both "Science" and "science" at the same time, but we do want to allow changing case, so "science" can be renamed "Science"?

Comment thread src/openedx_tagging/rest_api/v1/serializers.py
Comment thread tests/openedx_tagging/test_views.py
@jesperhodge
Copy link
Copy Markdown
Contributor Author

Hi @ormsbee ,

Just so I'm clear: Is the idea that we don't allow tags that differ just by case, i.e. I couldn't have both "Science" and "science" at the same time, but we do want to allow changing case, so "science" can be renamed "Science"?

That is correct, at least according to Jenna's remarks in UAT.
The idea is that we want to have different tags be unique. So tag A cannot have the same value as tag B, regardless of case.

But we should not check that new value of tag A is different than old value of A. That leads to unexpected validation errors, such as the case here where someone wants to rename a tag and he gets an error.

Regardless of whether he should get an error or not (according to UAT and common sense, no), throwing an error that says the new tag value is not unique - when in fact it is unique, just similar to the tag's old value - would be incorrect.

@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Apr 22, 2026
Comment thread src/openedx_tagging/rest_api/v1/serializers.py Outdated
@bradenmacdonald bradenmacdonald merged commit 36c9585 into openedx:main Apr 23, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Fix rename tag change capitalization - Backend

7 participants